﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using DAL;

namespace BLL
{
    public class SpecialPlan
    {

        DataStructure dllDataStructure = new DataStructure();


        /// <summary>
        /// 添加专项计划方法带事务
        /// </summary>
        /// <param name="_value">传入的参数集合</param>
        /// <returns>影响行数</returns>
        /// <author>grokyao</author>
        /// <date>2012-1-3</date>
        public int addWithTransaction(List<object[]> _valueList)
        {
            string _spName = "Insert_SpecialPlan";
            return dllDataStructure.getAffectRowsWithTransaction(_spName, _valueList);
        }

        /// <summary>
        /// 添加专项计划方法带事务
        /// </summary>
        /// <param name="_value">传入的参数集合</param>
        /// <returns>影响行数</returns>
        /// <author>grokyao</author>
        /// <date>2012-1-3</date>
        public int addWithTransactionForResolve(List<object[]> _valueList)
        {
            string _spName = "Insert_SpecialPlanDetail";
            return dllDataStructure.getAffectRowsWithTransaction(_spName, _valueList);
        }

        /// <summary>
        /// 批量提交
        /// </summary>
        /// <param name="_valueList"></param>
        /// <returns></returns>
        public int SubmitWithTransaction(List<object[]> _valueList)
        {
            string _spName = "Update_SpecialPlanStateById";
            return dllDataStructure.getAffectRowsWithTransaction(_spName, _valueList);
        }

        /// <summary>
        /// 批量提交明细
        /// </summary>
        /// <param name="_valueList"></param>
        /// <returns></returns>
        public int SubmitDetailWithTransaction(List<object[]> _valueList)
        {
            string _spName = "Update_SpecialPlanDetailStateById";
            return dllDataStructure.getAffectRowsWithTransaction(_spName, _valueList);
        }

        /// <summary>
        /// 批量退回
        /// </summary>
        /// <param name="_valueList"></param>
        /// <returns></returns>
        public int UnSubmitWithTransaction(List<object[]> _valueList)
        {
            string _spName = "Update_SpecialPlanUnSubmitById";
            return dllDataStructure.getAffectRowsWithTransaction(_spName, _valueList);
        }



        /// <summary>
        /// 根据专项计划Id批量删除
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public int DelByIdWithTransaction(List<object[]> _valueList)
        {
            string _spName = "Update_SpecialPlanById";
            return dllDataStructure.getAffectRowsWithTransaction(_spName, _valueList);
        }

        /// <summary>
        /// 根据部门查询
        /// </summary>
        /// <param name="_value"></param>
        /// <returns></returns>
        public DataTable GetSpecialPlanByDepartment(object[] _value)
        {
            string _spName = "Select_SpecialPlanByDepartment";
            return dllDataStructure.getDataTable(_spName, _value);
        }

        /// <summary>
        /// 根据部门、状态查询
        /// </summary>
        /// <param name="_value"></param>
        /// <returns></returns>
        public DataTable GetSpecialPlanByDepartmentAndState(object[] _value)
        {
            string _spName = "Select_SpecialPlanByDepartmentAndState";
            return dllDataStructure.getDataTable(_spName, _value);
        }

        /// <summary>
        /// 根据专项计划Id查询分解计划
        /// </summary>
        /// <param name="_value"></param>
        /// <returns></returns>
        public DataTable GetSpecialPlanDetailBySpecialId(object[] _value)
        {
            string _spName = "Select_SpecialPlanDetailBySpecialPlanId";
            return dllDataStructure.getDataTable(_spName, _value);
        }


        /// <summary>
        /// 根据专项计划Id查询分解计划ForList
        /// </summary>
        /// <param name="_value"></param>
        /// <returns></returns>
        public DataTable GetSpecialPlanDetailBySpecialIdForList(object[] _value)
        {
            string _spName = "Select_SpecialPlanDetailBySpecialPlanIdForList";
            return dllDataStructure.getDataTable(_spName, _value);
        }

        /// <summary>
        /// 根据专项计划分解Id查询分解计划
        /// </summary>
        /// <param name="_value"></param>
        /// <returns></returns>
        public DataTable GetSpecialPlanDetailById(object[] _value)
        {
            string _spName = "Select_SpecialPlanDetailById";
            return dllDataStructure.getDataTable(_spName, _value);
        }

        /// <summary>
        /// 删除专项计划分解
        /// </summary>
        /// <param name="_value"></param>
        /// <returns></returns>
        public int DelDetailById(object[] _value)
        {
            string _spName = "Update_SpecialPlanDetailById";
            return dllDataStructure.getAffectRows(_spName, _value);
        }

        /// <summary>
        /// 根据专项计划Id删除
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public int DelById(List<object[]> _valueList)
        {
            string _spName = "Update_SpecialPlanById";
            return dllDataStructure.getAffectRowsWithTransaction(_spName, _valueList);
        }

        /// <summary>
        /// 根据专项计划Id删除
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public int DelById(object[] _value)
        {
            string _spName = "Update_SpecialPlanById";
            return dllDataStructure.getAffectRows(_spName, _value);
        }




        /// <summary>
        /// 上传附件
        /// </summary>
        /// <param name="_value"></param>
        /// <returns></returns>
        public int UploadAttachmentPath(object[] _value)
        {
            string _spName = "Update_SpecialPlanAttachmengPathById";
            return dllDataStructure.getAffectRows(_spName, _value);
        }

        /// <summary>
        /// 根据Id查询
        /// </summary>
        /// <param name="_value"></param>
        /// <returns></returns>
        public DataTable GetSpecialPlanById(object[] _value)
        {
            string _spName = "Select_SpecialPlanById";
            return dllDataStructure.getDataTable(_spName, _value);
        }


        /// <summary>
        /// 根据Id更新专项计划
        /// </summary>
        /// <param name="_value"></param>
        /// <returns></returns>
        public int EditSpecialPlanById(object[] _value)
        {
            string _spName = "Update_SpecialPlanContentById";
            return dllDataStructure.getAffectRows(_spName, _value);
        }


        /// <summary>
        /// 根据Id更新专项计划分解
        /// </summary>
        /// <param name="_value"></param>
        /// <returns></returns>
        public int EditSpecialPlanDetailById(object[] _value)
        {
            string _spName = "Update_SpecialPlanDetailContentById";
            return dllDataStructure.getAffectRows(_spName, _value);
        }

        /// <summary>
        /// 根据评估人读取待评估和待审核的专项计划信息
        /// </summary>
        /// <param name="_value"></param>
        /// <returns></returns>
        public DataTable getSpecialPlanNoEvaluateAndNoVerify(object[] _value)
        {
            string _spName = "Select_SpecialPlanNoEvaluateAndNoVerify";
            return dllDataStructure.getDataTable(_spName, _value);
        }

        /// <summary>
        /// 根据Id退回专项计划
        /// </summary>
        /// <param name="_value"></param>
        /// <returns></returns>
        public int EditSpecialPlanReturnByIdWithTranscation(List<object[]> _value)
        {
            string _spName = "Update_SpecialPlanCheckNoteBySpecialPlanId";
            return dllDataStructure.getAffectRowsWithTransaction(_spName, _value);
        }

        /// <summary>
        /// 根据Id退回专项计划明细
        /// </summary>
        /// <param name="_value"></param>
        /// <returns></returns>
        public int EditSpecialPlanDetailReturnByIdWithTranscation(List<object[]> _value)
        {
            string _spName = "Update_SpecialPlanDetailCheckNoteBySpecialPlanId";
            return dllDataStructure.getAffectRowsWithTransaction(_spName, _value);
        }

        /// <summary>
        /// 根据Id审核通过专项计划
        /// </summary>
        /// <param name="_value"></param>
        /// <returns></returns>
        public int EditSpecialPlanOkByIdWithTranscation(List<object[]> _value)
        {
            string _spName = "Update_SpecialPlanPlanSendStateByEvaluatePeople";
            return dllDataStructure.getAffectRowsWithTransaction(_spName, _value);
        }

        /// <summary>
        /// 根据Id审核通过专项计划明细
        /// </summary>
        /// <param name="_value"></param>
        /// <returns></returns>
        public int EditSpecialPlanDetailOkByIdWithTranscation(List<object[]> _value)
        {
            string _spName = "Update_SpecialPlanDetailPlanSendStateByEvaluatePeople";
            return dllDataStructure.getAffectRowsWithTransaction(_spName, _value);
        }



        /// <summary>
        /// 根据评估人读取本人已评估并且已通过审核的月计划信息
        /// </summary>
        /// <param name="_value"></param>
        /// <returns></returns>
        public DataTable getSpecialPlanEvaluatedAndVerified(object[] _value)
        {
            string _spName = "Select_SpecialPlanEvaluatedAndVerified";
            return dllDataStructure.getDataTable(_spName, _value);

        }


        /// <summary>
        /// 根据年周期和评估人读取已评估的专项计划信息
        /// </summary>
        /// <param name="_value"></param>
        /// <returns></returns>
        public DataTable getSpecialPlanEvaluated(object[] _value)
        {
            string _spName = "Select_SpecialPlanEvaluated";
            return dllDataStructure.getDataTable(_spName, _value);
        }

        /// <summary>
        /// 提交二次评估状体
        /// </summary>
        /// <param name="_value"></param>
        /// <returns></returns>
        public int EditSpecialPlanEvaluate(object[] _value)
        {
            string _spName = "Update_SpecialPlanCheckNoteAndPlanSendStateById";
            return dllDataStructure.getAffectRows(_spName, _value);
        }

        /// <summary>
        /// 提交二次评估状体
        /// </summary>
        /// <param name="_value"></param>
        /// <returns></returns>
        public int EditSpecialPlanDetailEvaluate(object[] _value)
        {
            string _spName = "Update_SpecialPlanDetailCheckNoteAndPlanSendStateById";
            return dllDataStructure.getAffectRows(_spName, _value);
        }

    }
}
